<template>
  <div>
    <!-- v-on 事件绑定 -->
    <p>你要买的商品数量:{{ count }}</p>
    <button v-on:click="addFn">增加1个</button>
    <button v-on:click="addFive(5)">增加5个</button>
    <button @click="subFn">减1个</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: 0
    }
  },
  methods: {
    addFn() {
      this.count++
    },
    addFive(num) {
      this.count += num
    },
    subFn(){
      this.count--
    }
  }
}
</script>

<style>

</style>